package com.soft.dao;

import com.soft.entity.Trolley;
import com.soft.util.Connect;

import java.util.ArrayList;
import java.util.List;

/**
 * @author kongz
 * @version 1.0 2021/6/2 15:53
 * @description 购物车接口
 */
public class TrolleyDao {
    Class<Trolley> trolleyClass;

    public TrolleyDao() {
        trolleyClass = Trolley.class;
    }

    public Trolley getByUser(String userId) {
        List<Object> param = new ArrayList<>();
        param.add(userId);

        String sql = "select * from trolley where useraccount=?";
        return Connect.getInstance().queryObject(sql, param, trolleyClass);
    }
}
